package busmap.main;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class BusMapActivity extends TabActivity {
	public static TabHost tabHost;
    /** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    Resources res = getResources(); // Resource object to get Drawables
        tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab

	    // Create an Intent to launch an Activity for the tab (to be reused)
	    	intent = new Intent().setClass(this, BusInfo.class);
	    // Initialize a TabSpec for each tab and add it to the TabHost
	    	spec = tabHost.newTabSpec("businfo").setIndicator("Thông tin",res.getDrawable(R.drawable.ic_tab_info)).setContent(intent);
	    	tabHost.addTab(spec);

	    // Do the same for the other tabs
	    	/*
		    intent = new Intent().setClass(this, ListBusStop.class);
		    spec = tabHost.newTabSpec("busstop").setIndicator("Bến xe", res.getDrawable(R.drawable.ic_tab_busstop)).setContent(intent);
		    tabHost.addTab(spec);
		    */
		    intent = new Intent().setClass(this, Map.class);
		    spec = tabHost.newTabSpec("seachroute").setIndicator("Tìm đường", res.getDrawable(R.drawable.ic_tab_searchroute)).setContent(intent);
		    tabHost.addTab(spec);	
	
		    intent = new Intent().setClass(this, Settings.class);
		    spec = tabHost.newTabSpec("settings").setIndicator("Cài đặt", res.getDrawable(R.drawable.ic_tab_settings)).setContent(intent);
		    tabHost.addTab(spec);
		   tabHost.setCurrentTab(0);
	}
  
}